package com.dfbz.demo01_多线程实现聊天案例;

import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class AA {
    public static void main(String[] args) throws Exception{


        Socket socket = new Socket("localhost", 9011);

        OutputStream os = socket.getOutputStream();
        Scanner scanner = new Scanner(System.in);

        while (true){
            String str = scanner.nextLine();
            os.write(str.getBytes());
        }
    }


}
